package com.direct.domian;


import java.util.ArrayList;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
 * 账户类
 * 
 * @author Administrator
 * 
 */
public class Account {
	
	public static final Integer USABLE = 1;
	public static final Integer DISABLE = 2;
	
	private String id;
	/**
	 * 用户名
	 */
	private String username;
	/**
	 * 密码
	 */
	private String password;
	/**
	 * 当日登录错误次数
	 */
	private Integer errorCount;
	/**
	 * 上次登录时间
	 */
	private Date lastTime;
	/**
	 * 1:可用
	 * 2:不可用
	 */
	private Integer state;
	/**
	 *  角色
	 */
	private Set roles = new HashSet(0);
	/**
	 * 当前账户的所有订单信息
	 */
	private Set bills = new HashSet(0);
	
	private Set<Mail> mails=new HashSet<Mail>(0);
	// 所对应得客户信息
	private Custom custom;
	// 对应的员工
	private Employee emp;
	//所具有的权限
	private List<Power> power= new ArrayList<Power>();
	
	public Account() {
	}
	public Account(String id) {
		this.id = id;
	}
	public Account(String id, String username, String password,
			Integer errorCount, Date lastTime, Integer state, Set roles,
			Set bills, Set<Mail> mails, Custom custom, Employee emp) {
		this.id = id;
		this.username = username;
		this.password = password;
		this.errorCount = errorCount;
		this.lastTime = lastTime;
		this.state = state;
		this.roles = roles;
		this.bills = bills;
		this.mails = mails;
		this.custom = custom;
		this.emp = emp;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public Integer getErrorCount() {
		return errorCount;
	}

	public void setErrorCount(Integer errorCount) {
		this.errorCount = errorCount;
	}

	public Date getLastTime() {
		return lastTime;
	}

	public void setLastTime(Date lastTime) {
		this.lastTime = lastTime;
	}

	public Integer getState() {
		return state;
	}

	public void setState(Integer state) {
		this.state = state;
	}

	public Set getRoles() {
		return roles;
	}

	public void setRoles(Set roles) {
		this.roles = roles;
	}

	public Set getBills() {
		return bills;
	}

	public void setBills(Set bills) {
		this.bills = bills;
	}

	public Custom getCustom() {
		return custom;
	}

	public void setCustom(Custom custom) {
		this.custom = custom;
	}

	public Employee getEmp() {
		return emp;
	}

	public void setEmp(Employee emp) {
		this.emp = emp;
	}

	public Set<Mail> getMails() {
		return mails;
	}

	public void setMails(Set<Mail> mails) {
		this.mails = mails;
	}
	public List<Power> getPower() {
		return power;
	}
	public void setPower(List<Power> power) {
		this.power = power;
	}
	

}